{% extends "base.html" %}
{% load i18n %}
{% block title %} Tu Negocio Empresarios - Listar Clientes{% endblock %}
{% block head-css-ext %}
  <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/layout.css" media="screen" />
  <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/blue/style.css" media="print, projection, screen" />
{% endblock %}

{% block head-js-ext %}
  <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.js"></script>
  <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.tablesorter.js"></script>
  <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.tablePagination.js"></script>
  <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.translate.js"></script>
{% endblock %}

{% block head-js-embedded %}
  <script type="text/javascript">
	$(document).ready(function(){
	  var options = {
		firstArrow : (new Image()).src="{{MEDIA_URL}}img/icons/first.png",
		prevArrow : (new Image()).src="{{MEDIA_URL}}img/icons/prev.png",
		lastArrow : (new Image()).src="{{MEDIA_URL}}img/icons/last.png",
		nextArrow : (new Image()).src="{{MEDIA_URL}}img/icons/next.png"
	  }
	  $("#clientes")
		.tablesorter({widthFixed: true,  widgets: ['zebra'], headers : { 0 : { sorter: false }, 1 : { sorter: false }, 2 : { sorter: false }, 3 : { sorter: false }, 4 : { sorter: false } } })
		.tablePagination(options);
		
	  $("#tablePagination").translate('en', 'es');
	  
	});        
  </script>
{% endblock %}

{% block content-box1 %}
  <b> Empresarios Asociados a {{ usuario.first_name }} {{ usuario.last_name }} </b>
  <br><br>
  {% if empresarios %}
	<table id="clientes" class="tablesorter">
	  <thead>
		<tr align="center">
          <th>Empresario</th>
          <th>Email</th>
		  <th>Telefono</th>
		  <th>Editar Empresario</th>
		  <th>Agregar Prestamo Empresario</th>
        </tr>            
      </thead>
      <tbody>
		{% for empresario in empresarios %}
		  <tr align="center">
            <td>{{ empresario }}</td>
			<td>{{ empresario.email }}</td>
			<td>{{ empresario.telefono }}</td>
			<td><a href="{% url editar_empresario empresario.codigo %}" title="Editar Empresario"><img src="{{MEDIA_URL}}/img/pencil.png" border="0"/></a></td>
			<td><a href="{% url agregar_prestamo_empresario empresario.codigo %}" title="Agregar Prestamo Empresario"><img src="{{MEDIA_URL}}/img/pencil.png" border="0"/></a></td>
          </tr>
        {% endfor %}
      </tbody>
    </table>
  {% else %}
	<p><b>No tiene empresarios relacionados</b></p>
  {% endif %}
{% endblock %}

{% block content-colum2 %}
  {% if user.is_authenticated %}
	<ul>
	  <li><a href="{% url index %}">{% trans "Home" %}</a></li>
	  <li><a href="{% url empresarios %}">Empresarios</a></li>
      <li><a href="{% url agregar_empresarios %}">Agregar Empresarios</a></li>
    </ul>
  {% endif %}   
{% endblock %}